<?php
/**
 * Created by PhpStorm.
 * User: mars
 * Date: 2018/6/22
 * Time: 下午8:56
 */

namespace common\models;


class Likes extends \backend\models\Likes {

	public function like($p_id,$uid){
		$this->p_id = $p_id;
		$this->uid = $uid;
		if ($this->save()){
			return true;
		}
		return false;
	}
	public function isLike($p_id,$uid){
		if (self::findOne(['p_id'=>$p_id,'uid'=>$uid])){
			return true;
		}
		return false;
	}
	/**
	 * Returns static class instance, which can be used to obtain meta information.
	 *
	 * @param bool $refresh whether to re-create static instance even, if it is already cached.
	 *
	 * @return static class instance.
	 */
	public static function instance( $refresh = false ) {
		// TODO: Implement instance() method.
}}